package com.ruoyi.exam.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.ruoyi.exam.mapper.BkppingAccountDetailMapper;
import com.ruoyi.exam.domain.BkppingAccountDetail;
import com.ruoyi.exam.service.IBkppingAccountDetailService;

import javax.annotation.Resource;

/**
 * 账户消费Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-04
 */
@Service
@DataSource(value = DataSourceType.BOOKKEEPING)
public class BkppingAccountDetailServiceImpl implements IBkppingAccountDetailService 
{
    @Resource
    private BkppingAccountDetailMapper bkppingAccountDetailMapper;

    /**
     * 查询账户消费
     * 
     * @param id 账户消费主键
     * @return 账户消费
     */
    @Override
    public BkppingAccountDetail selectBkppingAccountDetailById(Long id)
    {
        return bkppingAccountDetailMapper.selectBkppingAccountDetailById(id);
    }

    /**
     * 查询账户消费列表
     * 
     * @param bkppingAccountDetail 账户消费
     * @return 账户消费
     */
    @Override
    public List<BkppingAccountDetail> selectBkppingAccountDetailList(BkppingAccountDetail bkppingAccountDetail)
    {
        return bkppingAccountDetailMapper.selectBkppingAccountDetailList(bkppingAccountDetail);
    }

    /**
     * 新增账户消费
     * 
     * @param bkppingAccountDetail 账户消费
     * @return 结果
     */
    @Override
    public int insertBkppingAccountDetail(BkppingAccountDetail bkppingAccountDetail)
    {
        bkppingAccountDetail.setCreateTime(DateUtils.getNowDate());
        return bkppingAccountDetailMapper.insertBkppingAccountDetail(bkppingAccountDetail);
    }

    /**
     * 修改账户消费
     * 
     * @param bkppingAccountDetail 账户消费
     * @return 结果
     */
    @Override
    public int updateBkppingAccountDetail(BkppingAccountDetail bkppingAccountDetail)
    {
        return bkppingAccountDetailMapper.updateBkppingAccountDetail(bkppingAccountDetail);
    }

    /**
     * 批量删除账户消费
     * 
     * @param ids 需要删除的账户消费主键
     * @return 结果
     */
    @Override
    public int deleteBkppingAccountDetailByIds(Long[] ids)
    {
        return bkppingAccountDetailMapper.deleteBkppingAccountDetailByIds(ids);
    }

    /**
     * 删除账户消费信息
     * 
     * @param id 账户消费主键
     * @return 结果
     */
    @Override
    public int deleteBkppingAccountDetailById(Long id)
    {
        return bkppingAccountDetailMapper.deleteBkppingAccountDetailById(id);
    }
}